package in.careerscale.apps.ocms.dao.model;

// Generated Jul 7, 2013 10:49:55 AM by Hibernate Tools 4.0.0

import static javax.persistence.GenerationType.IDENTITY;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * RoleMaster generated by hbm2java
 */
@Entity
@Table(name = "role_master", catalog = "ocms", uniqueConstraints = @UniqueConstraint(columnNames = "role_name"))
public class RoleMaster implements java.io.Serializable {

	private Integer id;
	private String roleName;
	private String description;
	private Set userRoles = new HashSet(0);
	private Set rolePermissions = new HashSet(0);

	public RoleMaster() {
	}

	public RoleMaster(String roleName) {
		this.roleName = roleName;
	}

	public RoleMaster(String roleName, String description, Set userRoles,
			Set rolePermissions) {
		this.roleName = roleName;
		this.description = description;
		this.userRoles = userRoles;
		this.rolePermissions = rolePermissions;
	}

	public RoleMaster(String name, String description)
	{
		this.roleName = name;
		this.description = description;
	}

	public RoleMaster(Integer id, String name, String description)
	{
		this.id=id;
		this.roleName = name;
		this.description = description;
	}


	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "role_name", unique = true, nullable = false, length = 45)
	public String getRoleName() {
		return this.roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	@Column(name = "description")
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "roleMaster")
	public Set<UserRole> getUserRoles()
	{
		return this.userRoles;
	}

	public void setUserRoles(Set<UserRole> userRoles)
	{
		this.userRoles = userRoles;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "roleMaster")
	public Set<RolePermission> getRolePermissions()
	{
		return this.rolePermissions;
	}

	public void setRolePermissions(Set rolePermissions) {
		this.rolePermissions = rolePermissions;
	}

}
